{% extends "extend/base.html" %} 
{% block title %} {{ title }} {% endblock %}
{% block page_content %}

	{% if name %}
		<h1>欢迎[{{ name }}]</h1>	
		<p>当前:{{ moment(current_time).fromNow(refresh=True) }}</p>
	{% endif %}
	{% if current_user.is_authenticated %}
		{{ macro.renderForm(form,'','') }}
	{% endif %}
	{{ macro.randerPost(posts,moment,current_user) }}
	{{ macro.pagination_widget(pagination,'main.index') }}

{% endblock %}

{% block scripts %}		
	{{ super() }}
	{{ pagedown.include_pagedown() }} <!-- 实现实时渲染markdown语法显示-->
	<script type="text/javascript">

		//测试js和python的flask通讯交互数据
		/*
		$("#myTestBtn").on('click',function(){
			//alert(" Hello Flask !")
			var mydata = {"msg":"Hello Flask."};
			$.getJSON('/convectorjs',{           // Flask中获取数据的function的url
			        mykey:JSON.stringify(mydata)      // 定义一个keyword, 将数据stringify
			    },function(data) {                    // 从Flask返回的数据
			    	var ret = data.result
			        //alert(ret.msgFlask+" "+ret.msg)			        
			    }
			);

		})*/

	</script>
{% endblock %}

{% block select_nav %}		
	selectPage(0);
{% endblock %}